# person_info = {
#     "name": "Alex",
#     "age": 30,
#     "country": "USA",
#     "language": ["English", "Spanish"],
#     "is_student": False
# }
#
# print(person_info["name"])
# person_info["age"] = 31
# person_info["height"] = 175
# del person_info["is_student"]
# person_info.update({"email":"alex@example.com"})
# person_info["language"] = ["English"]
# person_info["language"].append("French")
# length = len(person_info["language"])
# print(length)
# for i in range(1,4):
#     person_info[f"hobby{i}"] = f"hobby{i}"
#
# print(person_info)
import statistics

employees = {
    101: {
        "name": "Alice",
        "age": 30,
        "gender": "Female",
        "position": "Data Scientist",
        "team": "Research",
        "salary_history": [70000, 80000, 90000]
    },
    # 更多员工数据...
}

employees.update({102:{
    "name": "Bob",
    "age": 32,
    "gender": "Male",
    "position": "Data Scientist",
    "team": "Research",
    "salary_history": [70000, 80000, 90000]
}})
# employees.pop(102)
# del employees[102]

employees[101].update({
    "age": 31
})

employees[101]["salary_history"].append(95000)

print(statistics.mean(employees[101]["salary_history"]))

# high_age_employees = {}
# for Id,info in employees.items():
#     if info["age"] > 25:
#         high_age_employees[info["name"]] = Id
# print(high_age_employees)
#
# # 字典推导式
# high_age = {info["name"]:Id for Id,info in employees.items() if info["age"] > 25}
# print(high_age)

for employee in employees.values():
    employee["bonus"] = max(employee["salary_history"]) * 0.1

print(employees)